/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.eurotrader.entidades;

import br.com.eurotrader.interfaces.InterfaceEntidades;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Gilson
 */
@Entity
@Table(name = "grupotipoproblema")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Grupotipoproblema.findAll", query = "SELECT g FROM Grupotipoproblema g"),
    @NamedQuery(name = "Grupotipoproblema.findById", query = "SELECT g FROM Grupotipoproblema g WHERE g.id = :id"),
    @NamedQuery(name = "Grupotipoproblema.findByDescricao", query = "SELECT g FROM Grupotipoproblema g WHERE g.descricao = :descricao")})
public class Grupotipoproblema implements Serializable, InterfaceEntidades {
  
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Size(max = 60)
    @Column(name = "descricao")
    private String descricao;
//    @OneToMany(cascade = CascadeType.ALL, mappedBy = "grupotipoproblemaId")
//    private Collection<Tipoproblema> tipoproblemaCollection;

    public Grupotipoproblema() {
    }

    public Grupotipoproblema(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

//    @XmlTransient
//    public Collection<Tipoproblema> getTipoproblemaCollection() {
//        return tipoproblemaCollection;
//    }
//
//    public void setTipoproblemaCollection(Collection<Tipoproblema> tipoproblemaCollection) {
//        this.tipoproblemaCollection = tipoproblemaCollection;
//    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Grupotipoproblema)) {
            return false;
        }
        Grupotipoproblema other = (Grupotipoproblema) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.eurotrader.entidades.Grupotipoproblema[ id=" + id + " ]";
    }

   
    
}
